package com.gt.quality.system.entity.dto;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 用户信息表(SysUser)表实体类
 *
 * @author makejava
 * @since 2026-11-25 16:30:08
 */
@Data
public class SysUserDTO implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * Description:  用户ID
     */
    @TableField(value = "user_id")
    @Schema(title = "user_id", description = "用户ID")
    @TableId(value = "user_id", type = IdType.ASSIGN_ID)
    @JsonSerialize(using = ToStringSerializer.class)
    @JsonProperty("id")
    private Long userId;

    /**
     * Description:  部门ID
     */
    @TableField(value = "dept_id")
    @Schema(title = "dept_id", description = "部门ID")
    private Long deptId;

    /**
     * Description:  用户账号
     */
    @TableField(value = "user_name")
    @Schema(title = "user_name", description = "用户账号")
    private String userName;

    /**
     * Description:  用户昵称
     */
    @TableField(value = "nick_name")
    @Schema(title = "nick_name", description = "用户昵称")
    private String nickName;

    /**
     * Description:  用户类型（sys_user系统用户）
     */
    @TableField(value = "user_type")
    @Schema(title = "user_type", description = "用户类型（sys_user系统用户）")
    private String userType;

    /**
     * Description:  用户邮箱
     */
    @TableField(value = "email")
    @Schema(title = "email", description = "用户邮箱")
    private String email;

    /**
     * Description:  手机号码
     */
    @TableField(value = "phone_number")
    @Schema(title = "phone_number", description = "手机号码")
    private String phoneNumber;

    /**
     * Description:  用户性别（0男 1女 2未知）
     */
    @TableField(value = "sex")
    @Schema(title = "sex", description = "用户性别（0男 1女 2未知）")
    private String sex;

    /**
     * Description:  头像地址
     */
    @TableField(value = "avatar")
    @Schema(title = "avatar", description = "头像地址")
    private String avatar;


    /**
     * Description:  帐号状态（1正常 0停用）
     */
    @TableField(value = "status")
    @Schema(title = "status", description = "帐号状态（1正常 0停用）")
    private boolean status;

    /**
     * Description:  最后登录IP
     */
    @TableField(value = "login_ip")
    @Schema(title = "login_ip", description = "最后登录IP")
    private String loginIp;

    /**
     * Description:  最后登录时间
     */
    @TableField(value = "login_date")
    @Schema(title = "login_date", description = "最后登录时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime loginDate;

    /**
     * Description:  创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @Schema(title = "create_time", description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;


    /**
     * Description:  更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    @Schema(title = "update_time", description = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    /**
     * Description:  备注
     */
    @TableField(value = "remark")
    @Schema(title = "remark", description = "备注")
    private String remark;

    /**
     * Description:  部门名称
     */
    @TableField(value = "dept_name")
    @Schema(title = "dept_name", description = "部门名称")
    private String deptName;


}


